package org.codeart.strategy.example02;

import org.codeart.strategy.pojo.Receipt;
import org.codeart.strategy.pojo.ReceiptBuilder;

import java.util.List;

public class Client {

    public static void main(String[] args) {
        List<Receipt> list = ReceiptBuilder.build();
        list.forEach(r -> {
            if ("MT1101".equals(r.getType())) {
                System.out.println("接收到MT1101的回执信息");
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑A");
            } else if ("MT2101".equals(r.getType())) {
                System.out.println("接收到M2101的回执信息");
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑B");
            } else if ("MT4101".equals(r.getType())) {
                System.out.println("接收到MT4101的回执信息");
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑C");
            } else if ("MT8101".equals(r.getType())) {
                System.out.println("接收到MT8101的回执信息");
                System.out.println("解析回执内容");
                System.out.println("执行业务逻辑D");
            }
        });
    }

}
